#include <iostream>
using namespace std;
#include <string.h>


bool A(const char* str)
{   
    if(str == NULL)
    {
        return false;
    }
    int length = strlen(str);
    if(length <= 1)
    {
        return false;
    }
    for(int window = 1;window <= (length >> 1);window++)
    {
        //如果字符串不是窗口的整数倍
        if(length % window != 0)
        {
            continue;
        }

        //窗口里面是啥
        //填满窗口

        char subString[window + 1] = {0};
        strncpy(subString,str,window);

        subString[window] = '\0';
        
        int repeated = true;
        for(int idx = window;idx <= length - window ;idx += window)
        {
            if(strncmp(subString,str+idx,window) != 0)
            {
                repeated = false;
                break;
            }
            if(repeated == true)
            {
                return true;
            }
        }
    }
    return false;
}
int main()
{
    const char* str = "abcabcabc";

    cout<<A(str)<<endl;
}